<script>
var password = "aa";
myFunction();

function myFunction() {
  console.log(password);
}
</script>